#pragma once
#include "CProcess.h"
#include "afxtempl.h"

// CProcessList

typedef struct tagPROCESSITEM
{
	TCHAR lpProcessName[MAX_PATH];
	DWORD dwProcessID;

}PROCESSITEM, *PPROCESSITEM;


extern "C" class _declspec(dllexport) CProcessList : public CMFCListCtrl
{
	DECLARE_DYNAMIC(CProcessList)

public:
	CProcessList();
	virtual ~CProcessList();
	BOOL Init();
	void Setup();
	void WINAPI Refresh();
	void SetRefreshTime(int nTime);
protected:
	DECLARE_MESSAGE_MAP()
	static int WINAPI CompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);

private:
	//CProcess m_Process;
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	CImageList m_ImageList;
	void SetItemInfo(PROCESS_INFO ProcInfo, int nItem);
	int m_nRefreshTime;
	CMenu   m_menu;
	
	
public:
	afx_msg void OnTimer(UINT_PTR nIDEvent);
//	afx_msg void OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/);
//	afx_msg void OnNMRClick(NMHDR *pNMHDR, LRESULT *pResult);
//	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//	afx_msg void OnInject();
	afx_msg void OnLvnGetdispinfo(NMHDR *pNMHDR, LRESULT *pResult);
	//CArray <PROCESS_INFO, PROCESS_INFO> m_ItemArray;
	//CProcess m_Process;
};


